<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class CateInsertRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
         return [
        'tname'=>'required|regex:/([“.chr(0xa1).”-“.chr(0xa3).”][“.chr(0xa1).”-“.chr(0xff).”])/',
        
    
        ];
    }

     /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'tname.required' => '类别名不能为空',
            'tname.regex'  => '类别名需要2-18位中文组成',
        ];
    }
}
